package org.ehe.system.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.ehe.common.core.validate.AddGroup;
import org.ehe.common.core.validate.EditGroup;
import org.ehe.common.encrypt.annotation.EncryptField;
import org.ehe.common.encrypt.enumd.AlgorithmType;
import org.ehe.common.mybatis.core.domain.BaseEntity;
import org.ehe.common.sensitive.annotation.Sensitive;
import org.ehe.common.sensitive.core.SensitiveStrategy;
import org.ehe.system.domain.HrEmployeeFamily;

import java.util.Date;

/**
 * 员工家庭成员业务对象 hr_employee_family
 *
 * @author zhangnn
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = HrEmployeeFamily.class, reverseConvertGenerate = false)
public class HrEmployeeFamilyBo extends BaseEntity {


    /**
     * 家庭成员ID
     */
    @NotNull(message = "家庭成员ID不能为空", groups = { EditGroup.class })
    private Long familyId;

    /**
     * 员工ID
     */
    @NotNull(message = "员工ID不能为空", groups = { EditGroup.class })
    private Long employeeId;

    /**
     * 工号
     */
    @NotBlank(message = "工号不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 50, message = "工号长度不能超过{max}个字符")
    private String employeeNo;

    /**
     * 成员姓名
     */
    @NotBlank(message = "成员姓名不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 50, message = "成员姓名长度不能超过{max}个字符")
    @EncryptField(algorithm = AlgorithmType.AES)
    private String memberName;

    /**
     * 与员工关系（1父亲 2母亲 3配偶 4子女 5其他）
     */
    @NotBlank(message = "与员工关系不能为空", groups = { AddGroup.class, EditGroup.class })
    private String relationship;

    /**
     * 出生日期
     */
    private Date birthDate;

    /**
     * 身份证号
     */
    @Sensitive(strategy = SensitiveStrategy.ID_CARD)
    @EncryptField(algorithm = AlgorithmType.AES)
    @Size(max = 18, message = "身份证号长度不能超过{max}个字符")
    private String idCard;

    /**
     * 联系方式
     */
    @Sensitive(strategy = SensitiveStrategy.PHONE)
    @EncryptField(algorithm = AlgorithmType.AES)
    @Size(max = 20, message = "联系方式长度不能超过{max}个字符")
    private String phone;

    /**
     * 工作单位
     */
    @EncryptField(algorithm = AlgorithmType.AES)
    @Size(max = 200, message = "工作单位长度不能超过{max}个字符")
    private String workUnit;

    /**
     * 是否紧急联系人（0否 1是）
     */
    private String isEmergencyContact;

    /**
     * 数据加密标识（0否 1是）
     */
    private String isEncrypted;

}
